toSet

public abstract Set<Object> toSet()

Converts this set to a Set.

The type mapping rules for the set elements are the following:


| JavaScript         | Java           |
|--------------------|----------------|
| Number             | Double         |
| String             | String         |
| Boolean            | Boolean        |
| null and undefined | null           |
| Node               | Node, JsObject |
| ArrayBuffer        | byte[]         |
| Array              | List<?>        |
| Set                | Set<?>         |
| Map                | Map<?,?>       |
| Object             | JsObject       |
| Proxy Object       | Object         |

Proxy objects are mapped to the corresponding injected Java object.

Return

a set containing the converted elements from this set

Throws

when the JavaScript object is already disposed or invalid


public abstract Set<T> toSet<T>(Class<T> type)

Converts this set to a Set.

The type mapping rules for the set elements are the following:


| JavaScript         | Java           |
|--------------------|----------------|
| Number             | Double         |
| String             | String         |
| Boolean            | Boolean        |
| null and undefined | null           |
| Node               | Node, JsObject |
| ArrayBuffer        | byte[]         |
| Array              | List<?>        |
| Set                | Set<?>         |
| Map                | Map<?,?>       |
| Object             | JsObject       |
| Proxy Object       | Object         |

Proxy objects are mapped to the corresponding injected Java object.

All elements in this set must be of a type convertible to the type T according to the mapping rules.

Return

a set containing the converted elements from this set

Parameters

type

the Java type to convert elements in this set to, according to the mapping rules

<T>

the type of the converted elements

Throws

when the JavaScript object is already disposed or invalid